<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>跨境电子商务备案管理统一平台--登录</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'/>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <script type="text/javascript" src="${basePath}/js/jquery/jquery.min-1.11.3.js"></script>
    <script type="text/javascript" src="${basePath}/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="${basePath}/js/messagebox.js"></script>
    <link rel="stylesheet" href="${basePath}/css/base.css">
    <link rel="stylesheet" href="${basePath}/css/style.css">
    <script type="text/javascript" src="${basePath}/js/md5.js"></script>
    <link rel="shortcut icon" href="${basePath}/images/favicon.ico" type="image/x-icon"/>
    <script type="text/javascript">
        if (window != top) {
            top.location.href = location.href;
        }
        function setCookie(name, value, hours) {
            var d = new Date();
            d.setTime(d.getTime() + hours * 3600 * 1000);
            document.cookie = name + '=' + value + '; expires=' + d.toGMTString();
        }
        function getCookie(name) {
            var arr = document.cookie.split('; ');
            for (var i = 0; i < arr.length; i++) {
                var temp = arr[i].split('=');
                if (temp[0] == name) {
                    return temp[1];
                }
            }
            return '';
        }
        function removeCookie(name) {
            var d = new Date();
            d.setTime(d.getTime() - 10000);
            document.cookie = name + '=1; expires=' + d.toGMTString();
        }
        //使用MD5加密算法加密密码
        function changePassword() {
            var oldPassword = $("#password").val();
            var newPassword = hex_md5(oldPassword);
            $("#password").val(newPassword);
        }

        //表单验证方法
        function checkForms() {
//            var username = $("#username").val();
//            var password = $("#password").val();
//            if (!(username) || typeof(username) == "undefined" || username == "") {
//                showWarningMsg("用户名不能为空", "系统提示");
//                return false;
//            }
//            if (!(password) || typeof(password) == "undefined" || password == "") {
//                ShowMessages("密码不能为空", "系统提示", "msgwaring", null, 0);
//                return false;
//            }
//            changePassword();
//            setCookie("username", $("#username").val(), 300);
            $("#loginForm").submit();
        }
        <%--window.onload = function () {--%>
            <%--$("#username").val(getCookie("username"));--%>
            <%--if ('' != '${message}') {--%>
                <%--showWarningMsg('${message}');--%>
            <%--}--%>
            <%--$(document).keydown(function (e) {--%>
                <%--if (!e) {--%>
                    <%--e = window.event;--%>
                <%--}--%>
                <%--if ((e.keyCode || e.which) == 13) {--%>
                    <%--checkForms();--%>
                    <%--return false;--%>
                <%--}--%>
            <%--});--%>
        <%--};--%>
    </script>
</head>

<body>

<div class="bg1">
    <div class="bg2">
        <div class="bg3">
            <h1 class="loginLogo">山东电子口岸</h1>

            <h2 class="loginText">跨境电子商务单一窗口</h2>

            <form class="loginForm dib-wrap" id="loginForm" action="${basePath}/security/doLogin" method="post">
                <input type="text" value="admin" id="username" name="txtUserName" class="dib" placeholder="用户名"/>
                <input type="password" type="password" value="admin" id="password" name="passUserPassword"
                       class="dib" placeholder="密码"/>
                <input type="submit" class="dib" value="登录" id="loginButton" onclick="javascript:checkForms()"/>
                <a href="#" class="dib">注册</a>
            </form>
            <p class="loginLink"><a href="#">查看用户指南</a></p>
            <address class="loginFoot">山东电子口岸 Copyright &copy;2016</address>
        </div>
    </div>
</div>


</body>
</html>

